]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
viewSelector: remove the search entry's event grab
authorDan Winship <danw@gnome.org>
Wed, 16 Feb 2011 18:44:03 +0000 (13:44 -0500)
committerDan Winship <danw@gnome.org>
Thu, 24 Feb 2011 14:36:35 +0000 (09:36 -0500)
The search entry was taking a sort of grab when it was in the
focused-but-empty state, and would eat up most events for other actors
(except, confusingly, for panel actors). The only bit of "modality" we
really need here is that the entry is supposed to go back to the
unfocused state if you click somewhere outside it when it was in the
focused-but-empty state. So do that.

https://bugzilla.gnome.org/show_bug.cgi?id=642502

js/ui/viewSelector.js

index f3a98689864410ce91ec7d9104c8213a53646462..13f6847d20851f868c0b718d0c71adad2f890c2b 100644 (file)
@@ -161,8 +161,6 @@ SearchTab.prototype = {
     },
 
     _reset: function () {
-        this._entry.sync_hover();
-
         this._text.text = '';
 
         // Return focus to the viewSelector
@@ -262,18 +260,14 @@ SearchTab.prototype = {
 
     _onCapturedEvent: function(actor, event) {
         let source = event.get_source();
-        let panelEvent = source && Main.panel.actor.contains(source);
 
         switch (event.type()) {
             case Clutter.EventType.BUTTON_PRESS:
                 // the user clicked outside after activating the entry, but
                 // with no search term entered - cancel the search
-                if (source != this._text && this._text.text == '') {
+                if (source != this._text && this._text.text == '')
                     this._reset();
-                    // allow only panel events to continue
-                    return !panelEvent;
-                }
-                return false;
+                break;
             case Clutter.EventType.KEY_PRESS:
                 // If some "special" actor grabbed the focus (run
                 // dialog, looking glass); we don't want to interfere
@@ -305,13 +299,10 @@ SearchTab.prototype = {
                     this._text.event(event, false);
                 }
 
-                return false;
-            default:
-                // Suppress all other events outside the panel while the entry
-                // is activated and no search has been entered - any click
-                // outside the entry will cancel the search
-                return (this._text.text == '' && !panelEvent);
+                break;
         }
+
+        return false;
     },
 
     _doSearch: function () {